$(function () {

    $("#staffId").val( window.localStorage.staffId);
    $("#staffName").val(window.localStorage.loginName);
    $("#phone").val(window.localStorage.phone);
    $("#idCard").val(window.localStorage.idCard);
    $("#createdTime").val(window.localStorage.createdTime);
    $("#address").val(window.localStorage.address);

})


function updatePassword() {

    var password = $("#password").val();
    var inpassword = $("#inpassword").val();
    if (password == inpassword){
        $.ajax({
            url:"/UpdatePasswordServlet",
            type:'post',
            data:{
                password:password,
                staffId:$("#staffId").val()
            },
            dataType:'json',
            success:function (result) {
                if (result.status > 0) {
                    toastr['success']("操作成功");
                } else {
                    toastr['error']("操作失败");
                }
            }
        })
    }else {

        toastr['error']("密码不一致");
    }


}